#pragma once

#pragma unmanaged

#include <BWSAL\WorkerManager.h>

#pragma managed

#include "..\AiBase.h"
#include "Interfaces\IWorkerManager.h"
#include "Interfaces\IUnitArbitrator.h"
#include "Interfaces\IBaseManager.h"

namespace BroodWar
{
	namespace Addon
	{
		ref class Base;
		ref class BaseManager;

		public ref class WorkerManager : public AiBase, IWorkerManager
		{
		internal:
			BWSAL::WorkerManager* instance;

			WorkerManager(BWSAL::WorkerManager* manager);
			~WorkerManager();
			!WorkerManager();

			static WorkerManager^ s_instance;
		public:
			static void Create(IUnitArbitrator^ arbitrator, IBaseManager^ baseManager );
			static property WorkerManager^ Instance { WorkerManager^ get(); }

			virtual void OnOffer(IEnumerable<Unit^>^ units);
			virtual void OnRevoke(Unit^ unit, double bid);
			virtual void OnFrame() override;
			virtual void OnUnitComplete(Unit^ unit) override;
			virtual property String^ Name { String^ get(); }

			virtual void SetWorkersPerGas(int count);
			virtual double GetMineralRate();
			virtual double GetGasRate();
			virtual int GetOptimalWorkerCount();
			virtual int MineralWorkerCount();
			virtual int GasWorkerCount();
			virtual void EnableAutoBuild();
			virtual void DisableAutoBuild();
			virtual void SetAutoBuildPriority(int priority);
		};
	}
}
